#nullable enable

using System;

namespace PHMEE.CommonUtils;

public interface IPHMEETimeProvider
{
    DateTime GetUtcNow();

    DateTime GetUtcToday();
}

public class PHMEETimeProvider : TimeProvider, IPHMEETimeProvider
{
    public new DateTime GetUtcNow()
    {
        var utcNowDateTimeOffset = base.GetUtcNow();
        
        var utcNowDateTime = utcNowDateTimeOffset.DateTime;
        
        return DateTime.SpecifyKind(utcNowDateTime, DateTimeKind.Utc);
    }
    
    public DateTime GetUtcToday()
    {
        var today = GetUtcNow().Date;
        return DateTime.SpecifyKind(today, DateTimeKind.Utc);
    }
}